﻿using System.Collections.Generic;
using System.Xml.Serialization;

[XmlRoot(ElementName = "SQLFilterSchemeEntity")]
public class SQLFilterSchemeEntity
{
    // 修正为字符串类型（存储原始JSON）
    [XmlElement(ElementName = "SQLFilterSetting")]
    public string SQLFilterSettingJson { get; set; }  // 类型改为 string

    [XmlArray("FilterSetting")]
    [XmlArrayItem("Item")]
    public List<object> FilterSetting { get; set; } = new List<object>();

    [XmlElement(ElementName = "QuickFilterSetting")]
    public string QuickFilterSetting { get; set; }

    [XmlArray("SortSetting")]
    [XmlArrayItem("Item")]
    public List<object> SortSetting { get; set; } = new List<object>();

    // 修正为字符串类型（存储原始JSON）
    [XmlElement(ElementName = "BatchFilterSetting")]
    public string BatchFilterSettingJson { get; set; }  // 类型改为 string

    // 修正为字符串类型（存储原始JSON）
    [XmlElement(ElementName = "ColumnSetting")]
    public string ColumnSettingsJson { get; set; }  // 类型改为 string

    [XmlElement(ElementName = "CustomFilterSetting")]
    public string CustomFilterSetting { get; set; }

    [XmlArray("SummarySetting")]
    [XmlArrayItem("Item")]
    public List<object> SummarySetting { get; set; } = new List<object>();
}

// 過濾設置項結構
public class FilterSettingItem
{
    [XmlElement(ElementName = "KeyWord")]
    public string KeyWord { get; set; }

    [XmlElement(ElementName = "Value")]
    public string Value { get; set; }

    [XmlElement(ElementName = "IsTitle")]
    public bool IsTitle { get; set; }
}

// 批量過濾設置結構
public class BatchFilterSettings
{
    [XmlElement(ElementName = "MakeUpType")]
    public string MakeUpType { get; set; }

    [XmlArray("Source")]
    [XmlArrayItem("Item")]
    public List<object> Source { get; set; } = new List<object>();
}

// 欄位配置結構
public class ColumnSetting
{
    [XmlAttribute(AttributeName = "F")]
    public string FieldName { get; set; }

    [XmlAttribute(AttributeName = "V")]
    public int Visibility { get; set; }

    [XmlAttribute(AttributeName = "W")]
    public int Width { get; set; }

    [XmlAttribute(AttributeName = "L")]
    public bool IsLocked { get; set; }

    [XmlAttribute(AttributeName = "I")]
    public int Index { get; set; }
}